package coffeebar;

import java.util.*;


public class CurrentTransaction
    extends Transaction {
  User user;

  public void add(Item item) {
    super.add(item);
    Controller.getGUI().update();
  }

  public void setFree() {
    Iterator it = items.iterator();
    while (it.hasNext()) {
      Item item = (Item)it.next();
      item.setDiscount(user.getDiscountCoeff());
    }
  }

  public void setUser(User user) {
    this.user = user;
  }
}

